﻿<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<UI.Web.Models.RoomViewModel>" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>Index</title>
    <link rel="Stylesheet" href="~/Content/Site.css" />
</head>
<body>
  <div class="left-panel">
    <div class="account-panel">
    Your account: <span class="balance-amount"><%: Model.PlayerAccountBalance %></span>
    </div>
    <div class="current-games-panel">
     <%
         Html.RenderAction("GameList", "Room", new { playerLogin = User.Identity.Name }); 
     %>
     </div>
     </div>
    <div class="game-list-panel">
    <h2>Choose game</h2>
    <% foreach (var game in Model.GameList){ %>
        <div class="game-list-element">
        <div class="star"></div>
      <p>Preset: <span class="preset"><%: game.Preset %></span></p>                                     
      <p>Player: <span> <%: Html.ActionLink(game.Creator.Name,"Index","Profile", new {login=game.Creator.Login}, new {}) %> </span></p>
      <p><%: Html.ActionLink("Join the game","Index","Game", new {id = game.Id }, new {}) %></p>
      </div>
    <%} %>
    </div>
</body>
</html>
